package com.example.zuoye.service.impl;

import com.example.zuoye.dao.GoodsLikeDAO;
import com.example.zuoye.entity.Liked;
import com.example.zuoye.service.GoodLikeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodLikeServiceImpl implements GoodLikeService {

    @Autowired
    GoodsLikeDAO goodsLikeDAO;

    @Override
    public boolean addLikedService(Liked liked) {
        if (liked == null){
            return false;
        }
        return goodsLikeDAO.addLiked(liked);
    }

    @Override
    public List<Liked> getListLikedService(String userId) {
        return goodsLikeDAO.getListLiked(userId);
    }

    @Override
    public boolean updateLikedService(Liked liked) {
        return goodsLikeDAO.upadateLiked(liked);
    }

    @Override
    public Liked checkedLikeService(Liked liked) {
        return goodsLikeDAO.checkedLike(liked);
    }

    @Override
    public boolean updateGoodLike(Liked liked) {
        return goodsLikeDAO.updateGoodLike(liked);
    }
}
